<!DOCTYPE html>
<html lang="ZH">
<head>
    <meta charset="UTF-8">
    <title>后台首页</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
    <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap-theme.css" rel="stylesheet">
    <script type="text/javascript">
        //预览图
        $(document).ready(function () {
            $("input[name='banner']").change(function () {
                console.log('banner change');
                var file = this.files[0];
                url = URL.createObjectURL(file);
                $("#img").attr('src',url);
            });
        });
        $(document).ready(function () {
            $("#banner_reset").click(function () {
                window.location.reload(true);
            });
        });
    </script>
</head>
<body>
<div class="col-md-12" style="background-image: url('__PUBLIC__/img/logo.jpg');height: 120px;margin-bottom: 10px;">
    <div class="col-md-12 text-left">
        <h1><a href="{:U('index/index')}" style="text-decoration: none;color: white;">后台操作界面</a></h1>
    </div>
</div>
<div class="col-md-12 text-right" style="margin-bottom: 10px">
    <h7>当前登录用户&nbsp;&nbsp;<span><b>{$Think.session.user}</b></span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="{:U('index/logout')}">登出</a></h7>
</div>
<div class="col-md-12 row">
    <div class="col-md-2 text-center">
        <ul class="nav nav-pills nav-stacked">
          <li role="presentation" class="active">
				<a type="button" href="{:U('index/index')}" name="menu-btn" id="index" class="btn" style="width: 100%;">首&nbsp;&nbsp;页</a>
			</li>
            <li role="presentation" class="active">
                <a type="button" href="{:U('order/index')}" name="menu-btn" id="order-menu" class="btn" style="width: 100%;">预约处理</a>
            </li>
            <li role="presentation" class="active">
                <a type="button" href="{:U('good/index')}" name="menu-btn" id="good-menu" class="btn" style="width: 100%;">套餐管理</a>
            </li>
            <li role="presentation" class="active">
                <a type="button" href="{:U('user/index')}" name="menu-btn" id="account-menu" class="btn" style="width: 100%;">用户管理</a>
            </li>
            <li role="presentation" class="active">
                <a type="button" href="{:U('HomePage/index')}" name="menu-btn" id="banner-menu" class="btn" style="width: 100%;">首页设置</a>
            </li>
        </ul>
    </div>
    <div class="col-md-10" id="banner_panel" style="padding: 10px;border: 1px solid red">
        <h3 style="margin-top: -5px">首页管理</h3>
        <form action="/admin.php/HomePage/saveHomeInfo" method="post" id="banner_form" enctype="multipart/form-data">
            <div class="col-md-12" style="margin: 5px">
                <div class="col-md-5 row">
                    <div class="col-md-5 text-right">
                        <span>Banner图：</span>
                        <br>
                        <span style="color: red">(最佳分辨率：750*360)</span>
                    </div>
                    <div class="col-md-7 form-group" style="height: 200px;border: 1px solid gold">
                        <img src="{$data['pic_url']}" id="img" alt="封面图" class="form-control" style="height: 160px;width: 100%">
                        <label for="file" class="btn btn-info" style="width: 100%">上传图片</label>
                        <input id="file" type="file" name="banner" class="form-control btn btn-success" style="display: none">
                    </div>
                </div>
            </div>
            <div class="col-md-12" style="margin: 5px">
                <div class="col-md-5 row">
                    <div class="col-md-5 text-right">
                        <span>手机:</span>
                    </div>
                    <div class="col-md-7 text-left">
                        <input type="text" class="text-success" name="phone" value="{$data['phone']}">
                    </div>
                </div>
            </div>
            <div class="col-md-12" style="margin: 5px">
                <div class="col-md-5 row">
                    <div class="col-md-5 text-right">
                        <span>地址:</span>
                    </div>
                    <div class="col-md-7 text-left">
                        <input type="text" class="text-success" name="address" value="{$data['address']}">
                    </div>
                </div>
            </div>
            <div class="col-md-12" style="margin: 5px">
                <div class="col-md-5 row text-center">
                    <input type="submit" class="btn btn-success" id="banner_submit" value="提交">
                    <input type="button" class="btn btn-danger" id="banner_reset" value="重置">
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>